<template>
  <div>
    <el-collapse value="common">
      <el-collapse-item title="公共配置" name="common">
        <el-form :model="widget.UI.data" label-width="80px" size="mini" class="pad-lft-rgt-10">
          <el-row :gutter="10">
            <el-col :span="24">
              <el-form-item label="扩展类型">
                <el-select v-model="widget.UI.data.type" filterable
                           allow-create
                           clearable
                           default-first-option
                           placeholder="按回车键输入" class="width-100">
                  <el-option v-for="(item,index) in list" :key="index" :label="item.label"
                             :value='item.value'></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10" v-if="widget.UI.data.type==='faceRecognition'">
            <el-col :span="24">
              <el-form-item label="左边距">
                <el-input-number v-model="widget.UI.data.recognitionRect.left" placeholder="左边距" size="mini"
                                 class="width-100"></el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="上边距">
                <el-input-number v-model="widget.UI.data.recognitionRect.top" placeholder="左边距" size="mini"
                                 class="width-100"></el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="宽度">
                <el-input-number v-model="widget.UI.data.recognitionRect.width" placeholder="宽度" size="mini"
                                 class="width-100"></el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="高度">
                <el-input-number v-model="widget.UI.data.recognitionRect.height" placeholder="高度" size="mini"
                                 class="width-100"></el-input-number>
              </el-form-item>
            </el-col>
          </el-row>

        </el-form>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
  import {PlatformEZLink} from "@/modules/IDE/widget/custom/platformEZLink";

  export default {
    name: 'PlatformEZLink',
    props: {
      widget: {
        type: PlatformEZLink,
        default: () => {
          return {};
        }
      }
    },
    computed: {
      state() {
        return this.widget.getCurrentState();
      }
    },
    data() {
      return {
        list: [
          {label: "人脸识别", value: 'faceRecognition'}
        ]
      }
    }
  };
</script>

<style scoped>
</style>
